import "./public-path";
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import { createPinia } from "pinia";

import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "element-plus/dist/index.css";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import "@/assets/styles/index.css";
import "@/assets/styles/index.scss";
import "@/assets/font/index.css";

import components from "@/components";

import "@/router/permission";

import plugins from "./plugins";
import install from "./directives"; // 引入并使用自定义指令

const app = createApp(App);
// 图标引用不要删
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app
  .use(createPinia())
  .use(router)
  .use(ElementPlus, { locale: zhCn })
  .use(plugins)
  .use(components)
  .use(install)
  .mount("#factory-app");
